<template>
  <div style="margin: 20px">
    <SalaryForm ref="salaryForm" :isDisabled="false"/>
    <div class="fixed-button-container">
      <el-button type="primary" class="fixed-button" @click="goBack">返回</el-button>
      <el-button type="success" class="fixed-button" @click="save">保存</el-button>
    </div>
  </div>
</template>

<script setup>
import {onMounted, ref} from "vue";
import SalaryForm from './SalaryForm.vue'
import {useRoute, useRouter} from "vue-router";
import Salary from "@/api/Salary.js";
import {ElMessage} from "element-plus";

const route = useRoute()
const router = useRouter()

const salaryForm = ref(null);


onMounted(() => {
});

const goBack = () => {
  router.back()
}

const save = () => {
  salaryForm.value.save()
}
</script>

<style scoped>
.fixed-button-container {
  position: fixed;
  bottom: 50px; /* 距离底部的距离 */
  left: 50%; /* 水平居中定位 */
  transform: translateX(-50%); /* 偏移量，实现水平居中 */
  display: flex;
  justify-content: center; /* 水平居中按钮 */
  align-items: center; /* 垂直居中（如果需要的话） */
  z-index: 10;
}

.fixed-button {
  margin: 0 10px; /* 按钮之间的间距 */
  padding: 10px 20px; /* 按钮的内边距 */
}
</style>